#include "Board.h"
#include "Snake.h"

Board::Board() {
    snake = new Snake(this);
}
Board::~Board() {
    delete snake;
}

void Board::initialize()
{
    int i =0;
    for(int k = 0; k < CELL_WIDTH; k++, i += 2) {
        barriers[i].location.x = k;
        barriers[i + 1].location.x = k;
        barriers[i].location.y = 0;
        barriers[i + 1].location.y = CELL_HEIGHT - 1;
    }
    for(int k = 0; k < CELL_HEIGHT; k++, i += 2) {
        barriers[i].location.x = 0;
        barriers[i + 1].location.x = CELL_WIDTH - 1;
        barriers[i].location.y = k;
        barriers[i + 1].location.y = k;
    }
    snake->reset();
    food.relocate();
}